<!--业务流程--可疑品流业务流程-->
<template>
  <div style="margin: 0;padding: 0">
    <el-container>
      <!--页面表头设计-->
      <el-header style="height: 39px">
        <el-link class="headMain" href="http://10.255.96.48:3404/">{{ main.qualityManagementSystem }}</el-link>
        <span class="center-text">{{ main.productDataCheckListHandling }}</span>
        <el-popover
            placement="top-start"
            title="用户信息"
            width="200"
            trigger="hover">
          <div style="margin-top: 10px">Name：{{ useName }}</div>
          <div style="margin-top: 10px">ID:{{ useId }}</div>
          <div style="margin-top: 10px" @click="logOut">
            <el-link>退出</el-link>
          </div>
          <div class="headMain" slot="reference">{{ useName }}</div>
        </el-popover>
      </el-header>
      <el-container>
        <el-aside class="el-aside" width="200px" style="height: 90vh">
          <div style="margin-top: 5px;">
            <el-button style="width: 100%" :style="buttonStyle[0]" @click="buttonClick(0)">
              装配车间
            </el-button>
          </div>
          <div style="margin-top:10px;">
            <el-button style="width: 100%" :style="buttonStyle[1]" @click="buttonClick(1)">
              待开发{{ main.machiningWorkshop }}
            </el-button>
          </div>
          <div style="margin-top:10px;">
            <el-button style="width: 100%" :style="buttonStyle[2]" @click="buttonClick(2)">待开发{{ main.logistics }}
            </el-button>
          </div>
        </el-aside>
        <el-container>
          <!--主题设计-->
          <el-main class="el-main" style="height: calc(80vh - 83px);overflow: auto">
            <el-tabs v-model="activeName" @tab-click="handleClick">
              <el-tab-pane label="质量数据查询" name="checkList">
                <div style="margin-bottom: 5px; display: flex; justify-content: flex-end; ">
                  <!-- 发动机号筛选框 -->
                  <div style="font-size: 14px;margin-right: 5px;margin-left: 5px">
                    发动机号：
                    <el-input
                        placeholder="请输入发动机号"
                        v-model="engineNumberFilterValue"
                        size="mini" style="width: 250px;"
                        clearable>
                    </el-input>
                  </div>
                  <!-- 按工序筛选和选择列表 -->
                  <div style="font-size: 14px;margin-right: 5px;margin-left: 5px">
                    工序：
                    <el-select v-model="stationSelectList" size="mini" filterable placeholder="未选择"
                               style="width:120px;">
                      <el-option
                          v-for="item in stationSelectOptions"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value">
                      </el-option>
                    </el-select>
                  </div>
                  <!-- 时间筛选和选择列表 -->
                  <div style="font-size: 14px;margin-right: 5px;margin-left: 5px">
                    时间：
                    <el-date-picker
                        v-model="dateTimeScope"
                        type="datetimerange"
                        range-separator="至"
                        start-placeholder="开始时间"
                        end-placeholder="结束时间"
                        size="mini"
                        style="margin-right: 10px"
                        format="yyyy-MM-dd HH:mm:ss"
                        value-format="yyyy-MM-dd HH:mm:ss">
                    </el-date-picker>
                  </div>
                  <!-- 查询按钮 -->
                  <div style="text-align: right;">
                    <el-button type="primary" size="mini" icon="el-icon-search"
                               @click="conditionsAndDateScopeOfTorque()">查询
                    </el-button>
                  </div>
                </div>
                <!------------质量数据查询后的列表------------->
                <el-table
                    :data="queryTorqueListShowData"
                    border
                    :height="checkListTableHeight"
                    style="width: 100%"
                    v-loading="loding">
                  <el-table-column
                      label="序号"
                      align="center"
                      width="60"
                      v-slot:default="scope">
                    {{ scope.$index + 1 }}
                  </el-table-column>
                  <el-table-column
                      prop="f_STATION_ID"
                      label="工序"
                      align="center"
                      width="80"
                      :show-overflow-tooltip="true">
                  </el-table-column>
                  <el-table-column
                      prop="f_RECORD_ID"
                      label="发动机号"
                      align="center"
                      width="180"
                      :show-overflow-tooltip="true">
                  </el-table-column>
                  <el-table-column
                      prop="f_MEASURE_ID"
                      label="数据名"
                      align="center"
                      width="200"
                      :show-overflow-tooltip="true">
                  </el-table-column>
                  <el-table-column
                      prop="f_VALUE"
                      label="质量数据"
                      align="center"
                      width="100"
                      :show-overflow-tooltip="true">
                  </el-table-column>
                  <el-table-column
                      prop="f_BEGIN_TIME"
                      label="完成时间"
                      align="center"
                      width="230"
                      :show-overflow-tooltip="true">
                  </el-table-column>
                  <el-table-column
                      prop="mODEL_ID"
                      label="机型"
                      align="center"
                      width="130"
                      :show-overflow-tooltip="true">
                  </el-table-column>
                  <el-table-column
                      prop="uP_VALUE"
                      label="上限值"
                      align="center"
                      width="100"
                      :show-overflow-tooltip="true">
                  </el-table-column>
                  <el-table-column
                      prop="lOW_VALUE"
                      label="下限值"
                      align="center"
                      width="100"
                      :show-overflow-tooltip="true">
                  </el-table-column>
                  <el-table-column
                      prop="eXCEPT_VALUE"
                      label="中间值"
                      align="center"
                      width="100"
                      :show-overflow-tooltip="true">
                  </el-table-column>
                </el-table>
                <div>
                  <!--页面分页的内容-->
                  <el-pagination
                      @size-change="handleSizeChange"
                      @current-change="handleCurrentChange"
                      :current-page.sync=engineTorquePagination.currentPage
                      :page-size=engineTorquePagination.pageSize
                      layout="total, prev, pager, next"
                      :total=engineTorquePagination.total>
                  </el-pagination>
                </div>
              </el-tab-pane>
              <el-tab-pane label="物料数据查询" name="suspiciousDisposal">
                <div style="margin-bottom: 5px; display: flex; justify-content: flex-end; ">
                  <!-- 发动机号筛选框 -->
                  <div style="font-size: 14px;margin-right: 5px;margin-left: 5px">
                    工件：
                    <el-input
                        placeholder="请输入发动机号/工件号"
                        v-model="engineNumberFilterValue"
                        size="mini" style="width: 180px;"
                        clearable>
                    </el-input>
                  </div>
                  <!-- 物料名称筛选框 -->
                  <div style="font-size: 14px;margin-right: 5px;margin-left: 5px">
                    物料：
                    <el-input
                        placeholder="输入物料名称"
                        v-model="materialNameFilterValue"
                        size="mini" style="width: 180px;"
                        clearable>
                    </el-input>
                  </div>
                  <!-- 按工序筛选和选择列表 -->
                  <div style="font-size: 14px;margin-right: 5px;margin-left: 5px">
                    工序：
                    <el-select v-model="stationSelectList" size="mini" filterable placeholder="未选择"
                               style="width:130px;">
                      <el-option
                          v-for="item in stationSelectOptions"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value">
                      </el-option>
                    </el-select>
                  </div>
                  <!-- 时间筛选和选择列表 -->
                  <div style="font-size: 14px;margin-right: 5px;margin-left: 5px">
                    时间选择：
                    <el-date-picker
                        v-model="dateTimeScope"
                        type="datetimerange"
                        range-separator="至"
                        start-placeholder="开始时间"
                        end-placeholder="结束时间"
                        size="mini"
                        style="margin-right: 10px"
                        format="yyyy-MM-dd HH:mm:ss"
                        value-format="yyyy-MM-dd HH:mm:ss">
                    </el-date-picker>
                  </div>
                  <!-- 查询按钮 -->
                  <div style="text-align: right;">
                    <el-button type="primary" size="mini" icon="el-icon-search"
                               @click="conditionsAndDateScopeOfMaterial()">查询
                    </el-button>
                  </div>
                </div>
                <!------------物料信息查询数据表----------->
                <div>
                  <el-table
                      :data="queryMaterialListShowData"
                      border
                      :height="checkListTableHeight"
                      style="width: 100%"
                      v-loading="loding">
                    <el-table-column
                        label="序号"
                        align="center"
                        width="60"
                        v-slot:default="scope">
                      {{ scope.$index + 1 }}
                    </el-table-column>
                    <el-table-column
                        prop="f_STATION_ID"
                        label="工序"
                        align="center"
                        width="80"
                        :show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column
                        prop="f_RECORD_ID"
                        label="工件号"
                        align="center"
                        width="180"
                        :show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column
                        prop="f_PART_MATERIAL_ID"
                        label="零部件名称"
                        align="center"
                        width="240"
                        :show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column
                        prop="f_PART_MATERIAL_CODE"
                        label="零部件条码号"
                        align="center"
                        width="300"
                        :show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column
                        prop="f_PART_MATERIAL_QTY"
                        label="单台用量"
                        align="center"
                        width="80"
                        :show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column
                        prop="f_BEGIN_TIME"
                        label="记录时间"
                        align="center"
                        width="150"
                        :show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column
                        prop="f_PRODUCT_CODE"
                        label="机型"
                        align="center"
                        width="120"
                        :show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column
                        prop="iS_MAIN_MATERIAL"
                        label="物料类型"
                        align="center"
                        width="80"
                        :show-overflow-tooltip="true">
                    </el-table-column>
                  </el-table>
                </div>
                <div>
                  <!--页面分页的内容-->
                  <el-pagination
                      @size-change="handleSizeChangeOfMaterial"
                      @current-change="handleCurrentChangeOfMaterial"
                      :current-page.sync=engineMaterialPagination.currentPage
                      :page-size=engineMaterialPagination.pageSize
                      layout="total, prev, pager, next"
                      :total=engineMaterialPagination.total>
                  </el-pagination>
                </div>
              </el-tab-pane>
              <el-tab-pane label="过站信息查询" name="defectiveList">
                <div style="margin-bottom: 5px; display: flex; justify-content: flex-end; ">
                  <!-- 发动机号筛选框 -->
                  <div style="font-size: 14px;margin-right: 5px;margin-left: 5px">
                    发动机号：
                    <el-input
                        placeholder="请输入发动机号"
                        v-model="engineNumberFilterValue"
                        size="mini" style="width: 250px;"
                        clearable>
                    </el-input>
                  </div>
                  <!-- 按工序筛选和选择列表 -->
                  <div style="font-size: 14px;margin-right: 5px;margin-left: 5px">
                    工序：
                    <el-select v-model="stationSelectList" size="mini" filterable placeholder="未选择"
                               style="width:160px;">
                      <el-option
                          v-for="item in stationSelectOptions"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value">
                      </el-option>
                    </el-select>
                  </div>
                  <!-- 时间筛选和选择列表 -->
                  <div style="font-size: 14px;margin-right: 5px;margin-left: 5px">
                    时间选择：
                    <el-date-picker
                        v-model="dateTimeScope"
                        type="datetimerange"
                        range-separator="至"
                        start-placeholder="开始时间"
                        end-placeholder="结束时间"
                        size="mini"
                        style="margin-right: 10px"
                        format="yyyy-MM-dd HH:mm:ss"
                        value-format="yyyy-MM-dd HH:mm:ss">
                    </el-date-picker>
                  </div>
                  <!-- 查询按钮 -->
                  <div style="text-align: right;">
                    <el-button type="primary" size="mini" icon="el-icon-search" @click="conditionsAndDateScopeOfStation()">查询
                    </el-button>
                  </div>
                </div>
                <!------------过站数据查询后的列表------------->
                <el-table
                    :data="queryStationListShowData"
                    border
                    :height="checkListTableHeight"
                    style="width: 100%"
                    v-loading="loding">
                  <el-table-column
                      label="序号"
                      align="center"
                      width="60"
                      v-slot:default="scope">
                    {{ scope.$index + 1 }}
                  </el-table-column>
                  <el-table-column
                      prop="f_STATION_ID"
                      label="工序"
                      align="center"
                      width="100"
                      :show-overflow-tooltip="true">
                  </el-table-column>
                  <el-table-column
                      prop="f_RECORD_ID"
                      label="发动机号"
                      align="center"
                      width="180"
                      :show-overflow-tooltip="true">
                  </el-table-column>
                  <el-table-column
                      prop="f_BEGIN_TIME"
                      label="进站时间"
                      align="center"
                      width="200"
                      :show-overflow-tooltip="true">
                  </el-table-column>
                  <el-table-column
                      prop="f_END_TIME"
                      label="保存完成时间"
                      align="center"
                      width="200"
                      :show-overflow-tooltip="true">
                  </el-table-column>
                  <el-table-column
                      prop="f_PRODUCT_ID"
                      label="工件型号"
                      align="center"
                      width="160"
                      :show-overflow-tooltip="true">
                  </el-table-column>
                </el-table>
                <div>
                  <!--页面分页的内容-->
                  <el-pagination
                      @size-change="handleSizeChangeOfStation"
                      @current-change="handleCurrentChangeOfStation"
                      :current-page.sync=engineStationPagination.currentPage
                      :page-size=engineStationPagination.pageSize
                      layout="total, prev, pager, next"
                      :total=engineStationPagination.total>
                  </el-pagination>
                </div>
              </el-tab-pane>
              <el-tab-pane label="选瓦信息查询" name="repairCheckList">
                <div style="margin-bottom: 5px; display: flex; justify-content: flex-end; ">
                  <!-- 发动机号筛选框 -->
                  <div style="font-size: 14px;margin-right: 5px;margin-left: 5px">
                    发动机号：
                    <el-input
                        placeholder="请输入包含发动机的信息"
                        v-model="engineNumberFilterValue"
                        size="mini" style="width: 250px;"
                        clearable>
                    </el-input>
                  </div>
                  <!-- 时间筛选和选择列表 -->
                  <div style="font-size: 14px;margin-right: 5px;margin-left: 5px">
                    时间选择：
                    <el-date-picker
                        v-model="dateTimeScope"
                        type="datetimerange"
                        range-separator="至"
                        start-placeholder="开始时间"
                        end-placeholder="结束时间"
                        size="mini"
                        style="margin-right: 10px"
                        format="yyyy-MM-dd HH:mm:ss"
                        value-format="yyyy-MM-dd HH:mm:ss">
                    </el-date-picker>
                  </div>
                  <!-- 查询按钮 -->
                  <div style="text-align: right;">
                    <el-button type="primary" size="mini" icon="el-icon-search"
                               @click="conditionsAndDateScopeOfChoose()">查询
                    </el-button>
                  </div>
                </div>
                <!--数据绘图显示区域-->
                <div style="height: 300px ;display: flex;justify-content: space-between; border: 1px dashed #ccc;">
                  <div ref="crankshaftUpBearing" style="width: 24%; height: 100%; border: 1px solid #808080;">

                  </div>
                  <div ref="crankshaftDownBearing" style="width: 24%; height: 100%; border: 1px solid #808080;">

                  </div>
                  <div ref="connectingUpBearing" style="width: 24%; height: 100%; border: 1px solid #808080;">
                    连杆上瓦

                  </div>
                  <div ref="connectingDownBearing" style="width: 24%; height: 100%; border: 1px solid #808080;">
                    连杆下瓦


                  </div>
                </div>
                <!--数据列表显示区域-->
                <div>
                  <!------------质量数据查询后的列表------------->
                  <el-table
                      :data="queryChooseListShowData"
                      border
                      :height="checkListTableHeight"
                      style="width: 100%"
                      v-loading="loding">
                    <el-table-column
                        label="序号"
                        align="center"
                        width="60"
                        v-slot:default="scope">
                      {{ scope.$index + 1 }}
                    </el-table-column>
                    <el-table-column
                        prop="pRODUCT_ID"
                        label="发动机号"
                        align="center"
                        width="180"
                        :show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column
                        prop="pRINCIPAL_AXIS_NUM"
                        label="缸体分组号"
                        align="center"
                        width="100"
                        :show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column
                        prop="cONNECTING_ROD_NUM"
                        label="连杆分组号"
                        align="center"
                        width="100"
                        :show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column
                        prop="oPERATE_TIME"
                        label="录入时间"
                        align="center"
                        width="180"
                        :show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column
                        prop="bENT_AXLE_NUM"
                        label="曲轴分组号"
                        align="center"
                        width="110"
                        :show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column
                        prop="bENT_PRODUCT_ID"
                        label="曲轴号"
                        align="center"
                        width="140"
                        :show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column
                        prop="cONNECTING_PRODUCT_ID"
                        label="活连托盘号"
                        align="center"
                        width="140"
                        :show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column
                        prop="bENT_CHOOSE_DATA"
                        label="曲轴选瓦数据"
                        align="center"
                        width="130"
                        :show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column
                        prop="cONNECTING_CHOOSE_DATA"
                        label="连杆选瓦数据"
                        align="center"
                        width="130"
                        :show-overflow-tooltip="true">
                    </el-table-column>
                  </el-table>
                </div>
              </el-tab-pane>
            </el-tabs>
          </el-main>
          <el-footer class="el-footer" style="height: 44px">
            <el-button plain size="mini" @click="languageSelect('chinese')">中 文</el-button>
            <el-button plain size="mini" @click="languageSelect('russian')">Русский язык</el-button>
            <el-button plain size="mini" @click="languageSelect('english')">English</el-button>
          </el-footer>
        </el-container>
      </el-container>
    </el-container>

    <!-----------------------------------------------弹窗放置区--开始----------------------------------------------------->


    <!--------------------------------------------弹窗放置区域---结束------------------------------------------------------>


    <!--抽屉放置区域-->
  </div>
</template>

<script>
import E from "wangeditor";
import * as echarts from "echarts";

export default {
  name: "productDataCheckList",
  computed: {},
  data() {
    return {
      //用户权限相关的变量
      useName: '',//用户名称
      useId: '',//用户编号
      usePower: '',//用户权限
      //用户登录后默认为中文
      languageS: 'chinese',
      //切换语言，页面变量
      main: {
        qualityManagementSystem: '俄动力质量管理系统',
        productDataCheckListHandling: '发动机数据查询',
      },
      //分页显示的控制变量
      activeName: 'checkList',
      //导航区的按钮样式
      buttonStyle: [
        {backgroundColor: 'blue', color: 'white'},
        {backgroundColor: '', color: ''},
        {backgroundColor: '', color: ''},
      ],

      /*-------------------------发动机力矩列表中变量-----------------------------------------------------------------*/

      //发动机力矩查询--页面表单表头高度变量
      checkListTableHeight: window.visualViewport.height - 260,


      //发动机力矩查询--左侧选项栏中用来记录当前选中的工序按钮索引
      selectedOpIndex: null,
      //发动机力矩查询--数据显示表单，解析后台发送的数据，在表单中使用
      queryTorqueListShowData: [
        {
          //主键
          ID: '',
          //工序
          f_STATION_ID: '',
          //发动机号
          f_RECORD_ID: '',
          //力矩名称
          f_MEASURE_ID: '',
          //力矩值
          f_VALUE: '',
          //完成时间
          f_BEGIN_TIME: '',
          //机型
          mODEL_ID: '',
          //上限值
          uP_VALUE: '',
          //下限值
          lOW_VALUE: '',
          //中间值
          eXCEPT_VALUE: '',
        }
      ],
      //发动机物料信息查询--数据显示表单，用解析后台发送的数据，在表单中使用
      queryMaterialListShowData: [
        {
          //主键
          iD: '',
          //工序
          f_STATION_ID: '',
          //工件号
          f_RECORD_ID: '',
          //零部件名称
          f_PART_MATERIAL_ID: '',
          //零部件条码号
          f_PART_MATERIAL_CODE: '',
          //单台用量
          f_PART_MATERIAL_QTY: '',
          //记录时间
          f_BEGIN_TIME: '',
          //机型
          f_PRODUCT_CODE: '',
          //物料类型
          iS_MAIN_MATERIAL: '',
        }
      ],

      //发动机过站数据查询--数据显示表单，解析后台发送的数据，在表单中使用
      queryStationListShowData: [
        {
          //主键
          ID: '',
          //工序
          f_STATION_ID: '',
          //发动机号
          f_RECORD_ID: '',
          //开始时间
          f_BEGIN_TIME: '',
          //结束时间
          f_END_TIME:'',
          //机型
          f_PRODUCT_ID: ''
        }
      ],

      //发动机选瓦信息查询--数据显示表单，用解析后台发送的数据，在表单中使用
      queryChooseListShowData: [
        {
          //主键
          iD: '',
          //发动机号
          pRODUCT_ID: '',
          //缸体轴瓦编号
          pRINCIPAL_AXIS_NUM: '',
          //连杆录入的编号
          cONNECTING_ROD_NUM: '',
          //录入时间
          oPERATE_TIME: '',
          //曲轴选瓦的组号
          bENT_AXLE_NUM: '',
          //曲轴号
          bENT_PRODUCT_ID: '',
          //活连线录入的托盘号
          cONNECTING_PRODUCT_ID: '',
          //曲轴计算后的选瓦数据
          bENT_CHOOSE_DATA: '',
          //活连计算后的选瓦数据
          cONNECTING_CHOOSE_DATA: '',
        }
      ],


      //选瓦数据表---画图用
      charChooseBor: null,
      //选瓦数据表--曲轴上主轴瓦
      crankshaftUpBearing: null,
      //选瓦数据表--曲轴下主轴瓦
      crankshaftDownBearing: null,
      //选瓦数据表--连杆上瓦
      connectingUpBearing: null,
      //选瓦数据表--连杆下瓦
      connectingDownBearing: null,


      //AI品质门筛选区域--筛选用时间选择器
      dateTimeScope: [],
      //发动机数据筛选项，按工位进行筛选的选择列表
      stationSelectOptions: [
        {value: '', label: '全部/All/все'},
        {value: 'OP10.2', label: 'OP10'},
        {value: 'OP20', label: 'OP20'},
        {value: 'OP30.1', label: 'OP30-1'},
        {value: 'OP30.2', label: 'OP30'},
        {value: 'OP40', label: 'OP40'},
        {value: 'OP60', label: 'OP60'},
        {value: 'OP90', label: 'OP90'},
        {value: 'OP100', label: 'OP100'},
        {value: 'OP110', label: 'OP110'},
        {value: 'OP120', label: 'OP120'},
        {value: 'OP130', label: 'OP130'},
        {value: 'OP140', label: 'OP140'},
        {value: 'OP160', label: 'OP160'},
        {value: 'OP170', label: 'OP170'},
        {value: 'OP180', label: 'OP180'},
        {value: 'OP190', label: 'OP190'},
        {value: 'OP200', label: 'OP200'},
        {value: 'OP210', label: 'OP210'},
        {value: 'OP220', label: 'OP220'},
        {value: 'OP230', label: 'OP230'},
        {value: 'OP240-1', label: 'OP240.1'},
        {value: 'OP240-2', label: 'OP240.2'},
        {value: 'OP250', label: 'OP250'},
        {value: 'OP260', label: 'OP260'},
        {value: 'OP270', label: 'OP270'},
        {value: 'OP280.3', label: 'OP280-3'},
        {value: 'OP280.4', label: 'OP280-4'},
        {value: 'OP280.6', label: 'OP280-6'},
        {value: 'OP290', label: 'OP290'},
        {value: 'OP300', label: 'OP300'},
        {value: 'OP310', label: 'OP310'},
        {value: 'OP320', label: 'OP320'},
        {value: 'OP330.1', label: 'OP330'},
        {value: 'OP350.1', label: 'OP350'},
        {value: 'OP360', label: 'OP360'},
        {value: 'OP370', label: 'OP370'},
        {value: 'OP380', label: 'OP380'},
        {value: 'OP390.1', label: 'OP390-1'},
        {value: 'OP390.2', label: 'OP390-2'},
        {value: 'OP400', label: 'OP400'},
        {value: 'OP410.1', label: 'OP410-1'},
        {value: 'OP420', label: 'OP420'},
        {value: 'OP430', label: 'OP430'},
        {value: 'OP440', label: 'OP440'},
        {value: 'OP450', label: 'OP450'},
        {value: 'OP460', label: 'OP460'},
        {value: 'OP470', label: 'OP470'},
        {value: 'OP480', label: 'OP480'},
        {value: 'OP490', label: 'OP490'},
        {value: 'OP500', label: 'OP500'},
        {value: 'OP510', label: 'OP510'},
        {value: 'OP520', label: 'OP520'},
        {value: 'HL10', label: 'HL10'},
        {value: 'HL20', label: 'HL20'},
        {value: 'HL30', label: 'HL30'},
        {value: 'GG10', label: 'GG10'},
        {value: 'GG20.1', label: 'GG20-1'},
        {value: 'GG20.2', label: 'GG20-2'},
        {value: 'GG30', label: 'GG30'},
        {value: 'GG40.1', label: 'GG40-1'},
        {value: 'GG40.2', label: 'GG40-2'},
        {value: 'GG50.1', label: 'GG50-1'},
        {value: 'GG50.2', label: 'GG50-2'},
        {value: 'GG80', label: 'GG80'},
        {value: 'GG90', label: 'GG90'},
      ],
      //发动机数据查询--力矩查询--筛选后工序记录的值
      stationSelectList: '',
      //AI品质门筛选区域--发动机号筛选值
      engineNumberFilterValue: '',
      //发动机物料数据查询---物料名称
      materialNameFilterValue: '',
      //发动机力矩查询----表格分页变量
      engineTorquePagination: {
        //当前页数
        currentPage: 1,
        //每页显示条数
        pageSize: 20,
        //总条目数
        total: 0,
      },
      //发动机过站查询----表格分页变量
      engineStationPagination: {
        //当前页数
        currentPage: 1,
        //每页显示条数
        pageSize: 20,
        //总条目数
        total: 0,
      },

      //发动机物料查询-----表格分页变量
      engineMaterialPagination: {
        //当前页数
        currentPage: 1,
        //每页显示条数
        pageSize: 20,
        //总条目数
        total: 0,
      },
      //加载时提示的忙
      loding: false,

      //存放富文本
      editor: null
    }
  },

  watch: {
    //监视数据变化的函数
  },

  methods: {
    //退出登录
    logOut() {
      localStorage.removeItem('u_token');
      localStorage.removeItem('userName')
      this.$router.push('UserLogin')
    },
    //查询用户信息的函数
    inquiry() {
      //输入用户编号，向后端查询信息
      const useId = localStorage.getItem('userName').replace(/"/g, '');
      this.$request.post('/useQueryPower', {
        queryFiledName: 'goodProductCondition',
        userId: useId,
      }).then(result => {
        if (result.code === 401) {
          this.$router.push('UserLogin')
          alert("您未登录，请登录")
        } else {
          this.useName = result.data.name
          this.usePower = result.data.goodProductCondition
          this.useId = useId
        }
      })
    },
    //语言切换选择的函数
    languageSelect(language) {
      this.languageS = language
      if (language === 'chinese') {
        //main
        this.main.qualityManagementSystem = '俄动力质量管理系统'
        this.main.productDataCheckListHandling = '发动机数据查询'
      } else if (language === 'english') {
        //main
        this.main.qualityManagementSystem = 'Quality Management System'
        this.main.productDataCheckListHandling = 'Engine Data Query'
      } else if (language === 'russian') {
        //main
        this.main.qualityManagementSystem = 'Система управления качеством'
        this.main.productDataCheckListHandling = 'Запрос данных двигателя'
      }
    },
    //发动机质量数据查询--力矩查询页面--分页功能函数-页面条数改变时
    handleSizeChange() {
      //不用
    },
    //发动机数据查询--力矩查询页面--分页功能函数-当前页改变时
    handleCurrentChange(val) {
      //调用查询的函数
      if ((this.dateTimeScope !== null && this.dateTimeScope.length > 0) ||
          this.engineNumberFilterValue !== '' ||
          this.stationSelectList !== '') {
        this.queryMultipleConditionsEngineDataQuery(this.engineNumberFilterValue, this.stationSelectList, this.dateTimeScope[0], this.dateTimeScope[1], val, this.engineTorquePagination.pageSize).then(data => {
          this.queryTorqueListShowData = data.data
        })
      } else {
        this.$message.error("查询条件缺失，请检查查询条件")
      }
    },

    //发动机物料数据查询--物料查询页面--分页功能函数-页面条数改变时
    handleSizeChangeOfMaterial() {
      //不用
    },
    //发动机物料数据查询--物料查询页面--分页功能函数-当前页改变时
    handleCurrentChangeOfMaterial(val) {
      //调用查询的函数
      if ((this.dateTimeScope !== null && this.dateTimeScope.length > 0) ||
          this.engineNumberFilterValue !== '' ||
          this.stationSelectList !== '' ||
          this.materialNameFilterValue !== '') {
        this.queryMaterialEngineDataQuery(this.engineNumberFilterValue, this.materialNameFilterValue, this.stationSelectList, this.dateTimeScope[0], this.dateTimeScope[1], val, this.engineTorquePagination.pageSize).then(data => {
          this.queryMaterialListShowData = data.data
        })
      } else {
        this.$message.error("查询条件缺失，请检查查询条件")
      }
    },

    //发动机物料数据查询--物料查询页面--分页功能函数-页面条数改变时
    handleSizeChangeOfStation() {
      //不用
    },
    //发动机过站数据查询--力矩查询页面--分页功能函数-当前页改变时
    handleCurrentChangeOfStation(val) {
      //调用查询的函数
      if ((this.dateTimeScope !== null && this.dateTimeScope.length > 0) ||
          this.engineNumberFilterValue !== '' ||
          this.stationSelectList !== '') {
        this.queryStationEngineDataQuery(this.engineNumberFilterValue, this.stationSelectList, this.dateTimeScope[0], this.dateTimeScope[1], val, this.engineTorquePagination.pageSize).then(data => {
          this.queryStationListShowData = data.data
        })
      } else {
        this.$message.error("查询条件缺失，请检查查询条件")
      }
    },

    //在可疑品业务页面中点击tabs标签页的显示调用函数，当页面等于设定的标签，对后端进行发送post请求
    handleClick() {
      //点击页面标签的函数（网页中名字为质量数据查询），暂时不用
    },

    //页面左侧导航栏中选择不同的按钮后，对应选中的按钮进行背景色和文字颜色进行设定和变更，展示选定的项目
    buttonClick(doe) {
      if (doe === 0) {
        this.buttonStyle = [
          {backgroundColor: 'blue', color: 'white'},
          {backgroundColor: '', color: ''},
          {backgroundColor: '', color: ''}
        ];
      } else if (doe === 1) {
        this.buttonStyle = [
          {backgroundColor: '', color: ''},
          {backgroundColor: 'blue', color: 'white'},
          {backgroundColor: '', color: ''}
        ];
      } else if (doe === 2) {
        this.buttonStyle = [
          {backgroundColor: '', color: ''},
          {backgroundColor: '', color: ''},
          {backgroundColor: 'blue', color: 'white'}
        ];
      }
    },
    // 装配车间的展开项，OP工位名称选择
    handleOperationClick(op, index) {
      this.selectedOpIndex = index;
      console.log(`工序 ${op} 被点击了!${index}`);
    },
    //AI品质门
    assemblyStationButtonStyle(index) {
      // 如果当前按钮是选中的，返回选中样式
      if (this.selectedOpIndex === index) {
        return {backgroundColor: 'lightgray', color: 'white'};  // 可以自定义样式
      }
      // 否则返回默认样式
      return {backgroundColor: 'transparent', color: 'black'};
    },

    //发动机力矩查询按钮--按条件和时间筛选的监视函数--用户筛选后显示数据
    conditionsAndDateScopeOfTorque() {
      if ((this.dateTimeScope !== null && this.dateTimeScope.length > 0) ||
          this.engineNumberFilterValue !== '' ||
          this.stationSelectList !== '') {
        this.queryMultipleConditionsEngineDataQuery(this.engineNumberFilterValue, this.stationSelectList, this.dateTimeScope[0], this.dateTimeScope[1], 1, this.engineTorquePagination.pageSize).then(data => {
          this.queryTorqueListShowData = data.data
          this.engineTorquePagination.total = data.total
        })
      } else {
        this.$message.error("未检测到筛选的数据")
      }
    },
    //发动机物料查询按钮--按条件和时间筛选的监视函数--用户筛选后显示数据
    conditionsAndDateScopeOfMaterial() {
      if ((this.dateTimeScope !== null && this.dateTimeScope.length > 0) ||
          this.engineNumberFilterValue !== '' ||
          this.stationSelectList !== '' ||
          this.materialNameFilterValue !== '') {
        this.queryMaterialEngineDataQuery(this.engineNumberFilterValue, this.materialNameFilterValue, this.stationSelectList, this.dateTimeScope[0], this.dateTimeScope[1], 1, this.engineTorquePagination.pageSize).then(data => {
          this.queryMaterialListShowData = data.data
          this.engineMaterialPagination.total = data.total
        })
      } else {
        this.$message.error("未检测到筛选的数据")
      }
    },

    //发动机过站数据查询按钮--按条件和时间筛选的监视函数--用户筛选后显示数据
    conditionsAndDateScopeOfStation() {
      if ((this.dateTimeScope !== null && this.dateTimeScope.length > 0) ||
          this.engineNumberFilterValue !== '' ||
          this.stationSelectList !== '' ) {
        this.queryStationEngineDataQuery(this.engineNumberFilterValue, this.stationSelectList, this.dateTimeScope[0], this.dateTimeScope[1], 1, this.engineTorquePagination.pageSize).then(data => {
          this.queryStationListShowData = data.data
          this.engineStationPagination.total = data.total
        })
      } else {
        this.$message.error("未检测到筛选的数据")
      }
    },

    //发动机轴瓦数据查询按钮--按条件和时间筛选的监视函数--用户筛选后显示数据
    conditionsAndDateScopeOfChoose() {
      if (this.dateTimeScope === '' || this.dateTimeScope === null || this.dateTimeScope === undefined || this.dateTimeScope.length < 2) {
        this.dateTimeScope = []
        if (this.engineNumberFilterValue === '') {
          this.$message.error("未检测到筛选的数据")
          return // 如果两个条件都为空，直接返回，不执行后续逻辑
        }
      }
      this.queryChooseEngineDataQuery(this.engineNumberFilterValue, this.dateTimeScope[0], this.dateTimeScope[1]).then(data => {
        this.queryChooseListShowData = data.data
        //画直方图，如果只有一条数据就不用画图了，如果多条数据，可以画图
        if (this.queryChooseListShowData.length > 1) {
          let bearing = {
            title: {
              text: '无信息',        // 主标题文本
              subtext: '',              //副标题
              left: 'center',         // 标题位置（left/center/right/数值）
              top: 'top',             // 标题垂直位置（top/center/bottom/数值）
              textStyle: {
                color: '#333',        // 标题颜色
                fontSize: 18,         // 标题字号
                fontWeight: 'bold'    // 字体粗细
              },
              subtextStyle: {
                color: '#aaa'         // 副标题样式
              }
            },
            tooltip: {
              trigger: 'axis',
              axisPointer: {
                type: 'shadow'
              }
            },
            grid: {
              top: '3%',
              left: '3%',
              right: '4%',
              bottom: '10%',
              containLabel: true
            },
            xAxis: [
              {
                type: 'category',
                data: [],
                axisTick: {
                  alignWithLabel: true
                }
              }
            ],
            yAxis: [
              {
                type: 'value',
                min: '',   // 自动根据数据计算最小值
                max: ''    // 自动根据数据计算最大值
              }
            ],
            series: [
              {
                name: 'Direct',
                type: 'bar',
                barWidth: '60%',
                data: [],
                label: {
                  show: true,  // 启用标签显示
                  position: 'top',  // 标签位置：'top' 表示显示在柱状图顶部
                  color: '#000',  // 标签颜色，默认是黑色
                  fontSize: 10,  // 标签字体大小
                  fontWeight: 'bold', // 标签字体粗细
                  formatter: function (params) {
                    // 参数 params 为每个柱子的对应数据
                    return `${params.value}%`;
                  }  // 在数据值后面加上百分号
                }
              }
            ]
          }
          //计算上主轴瓦的数据
          bearing.title.text = "上主轴瓦"
          bearing.xAxis[0].data = []
          bearing.xAxis[0].data.push("EN:红\nEB:黄")
          bearing.xAxis[0].data.push("EN:蓝\nEB:无")
          bearing.xAxis[0].data.push("EN:黄\nEB:蓝")
          bearing.yAxis[0].min = 0
          bearing.yAxis[0].max = 120
          let contNumber = {
            red: 0,
            blue: 0,
            yellow: 0,
          }
          //计算对应轴瓦的数量
          for (let i = 0; i < this.queryChooseListShowData.length; i++) {
            //得到前5个字符
            let strString = this.queryChooseListShowData[i].bENT_CHOOSE_DATA.slice(0, 5)
            contNumber.red = contNumber.red + strString.split('1').length - 1
            contNumber.blue = contNumber.blue + strString.split('2').length - 1
            contNumber.yellow = contNumber.yellow + strString.split('3').length - 1
          }
          //计算轴瓦使用的总数
          let total = contNumber.red + contNumber.yellow + contNumber.blue
          console.log(
              "当前筛选中上主轴瓦使用的1号瓦数量：" + contNumber.red + "，2号瓦数量：" + contNumber.blue + "，3号瓦数量：" + contNumber.yellow)
          //计算各颜色的分布的百分比
          contNumber.red = ((contNumber.red / total) * 100).toFixed(2);
          contNumber.blue = ((contNumber.blue / total) * 100).toFixed(2);
          contNumber.yellow = ((contNumber.yellow / total) * 100).toFixed(2);
          //给柱状图赋值
          bearing.series[0].data = []
          bearing.series[0].data.push(contNumber.red)
          bearing.series[0].data.push(contNumber.blue)
          bearing.series[0].data.push(contNumber.yellow)
          //画图实例-画上主轴瓦
          if (this.$refs.crankshaftUpBearing) {
            // 初始化图表并设置选项
            this.crankshaftUpBearing = echarts.init(this.$refs.crankshaftUpBearing);
            this.crankshaftUpBearing.setOption(bearing);
          } else {
            console.error('DOM element not found for chart initialization');
          }


          //***画图实例***--------画下主轴瓦-----------------------------
          bearing.title.text = "下主轴瓦"
          bearing.xAxis[0].data = []
          bearing.xAxis[0].data.push("EN:红\nEB:黄")
          bearing.xAxis[0].data.push("EN:蓝\nEB:无")
          bearing.xAxis[0].data.push("EN:黄\nEB:蓝")
          contNumber = {
            red: 0,
            blue: 0,
            yellow: 0,
          }
          //计算对应下主轴瓦的数量
          for (let i = 0; i < this.queryChooseListShowData.length; i++) {
            //得到后面的5个字符
            let strString = this.queryChooseListShowData[i].bENT_CHOOSE_DATA.slice(5)
            contNumber.red = contNumber.red + strString.split('1').length - 1
            contNumber.blue = contNumber.blue + strString.split('2').length - 1
            contNumber.yellow = contNumber.yellow + strString.split('3').length - 1
          }
          //计算轴瓦使用的总数
          total = contNumber.red + contNumber.yellow + contNumber.blue
          console.log(
              "当前筛选中下主轴瓦使用的1号瓦数量：" + contNumber.red + "，2号瓦数量：" + contNumber.blue + "，3号瓦数量：" + contNumber.yellow)
          //计算各颜色的分布的百分比
          contNumber.red = ((contNumber.red / total) * 100).toFixed(2);
          contNumber.blue = ((contNumber.blue / total) * 100).toFixed(2);
          contNumber.yellow = ((contNumber.yellow / total) * 100).toFixed(2);
          //给柱状图赋值
          bearing.series[0].data = []
          bearing.series[0].data.push(contNumber.red)
          bearing.series[0].data.push(contNumber.blue)
          bearing.series[0].data.push(contNumber.yellow)
          //画图实例-画下主轴瓦
          if (this.$refs.crankshaftDownBearing) {
            // 初始化图表并设置选项
            this.crankshaftDownBearing = echarts.init(this.$refs.crankshaftDownBearing);
            this.crankshaftDownBearing.setOption(bearing);
          } else {
            console.error('DOM element not found for chart initialization');
          }


          //***画图实例***--------画上连杆瓦-----------------------------
          bearing.title.text = "上连杆瓦"
          bearing.xAxis[0].data = []
          bearing.xAxis[0].data.push("红")
          bearing.xAxis[0].data.push("蓝")
          bearing.xAxis[0].data.push("黄")
          contNumber = {
            red: 0,
            blue: 0,
            yellow: 0,
          }
          //计算对应上连杆瓦的数量
          for (let i = 0; i < this.queryChooseListShowData.length; i++) {
            //得到前面的4个字符
            let strString = this.queryChooseListShowData[i].cONNECTING_CHOOSE_DATA.slice(0, 4)
            contNumber.red = contNumber.red + strString.split('1').length - 1
            contNumber.blue = contNumber.blue + strString.split('2').length - 1
            contNumber.yellow = contNumber.yellow + strString.split('3').length - 1
          }
          //计算连杆瓦使用的总数
          total = contNumber.red + contNumber.yellow + contNumber.blue
          console.log(
              "当前筛选中上连杆瓦使用的1号瓦数量：" + contNumber.red + "，2号瓦数量：" + contNumber.blue + "，3号瓦数量：" + contNumber.yellow)
          //计算各颜色的分布的百分比
          contNumber.red = ((contNumber.red / total) * 100).toFixed(2);
          contNumber.blue = ((contNumber.blue / total) * 100).toFixed(2);
          contNumber.yellow = ((contNumber.yellow / total) * 100).toFixed(2);

          //给柱状图赋值
          bearing.series[0].data = []
          bearing.series[0].data.push(contNumber.red)
          bearing.series[0].data.push(contNumber.blue)
          bearing.series[0].data.push(contNumber.yellow)
          //画图实例-画上连杆瓦
          if (this.$refs.connectingUpBearing) {
            // 初始化图表并设置选项
            this.connectingUpBearing = echarts.init(this.$refs.connectingUpBearing);
            this.connectingUpBearing.setOption(bearing);
          } else {
            console.error('DOM element not found for chart initialization');
          }

          //***画图实例***--------画下连杆瓦-----------------------------
          bearing.title.text = "下连杆瓦"
          bearing.xAxis[0].data = []
          bearing.xAxis[0].data.push("红")
          bearing.xAxis[0].data.push("蓝")
          bearing.xAxis[0].data.push("黄")
          contNumber = {
            red: 0,
            blue: 0,
            yellow: 0,
          }
          //计算对应上连杆瓦的数量
          for (let i = 0; i < this.queryChooseListShowData.length; i++) {
            //得到后面的4个字符
            let strString = this.queryChooseListShowData[i].cONNECTING_CHOOSE_DATA.slice(4)
            contNumber.red = contNumber.red + strString.split('1').length - 1
            contNumber.blue = contNumber.blue + strString.split('2').length - 1
            contNumber.yellow = contNumber.yellow + strString.split('3').length - 1
          }
          //计算连杆瓦使用的总数
          total = contNumber.red + contNumber.yellow + contNumber.blue
          console.log(
              "当前筛选中下连杆瓦使用的1号瓦数量：" + contNumber.red + "，2号瓦数量：" + contNumber.blue + "，3号瓦数量：" + contNumber.yellow)
          //计算各颜色的分布的百分比
          contNumber.red = ((contNumber.red / total) * 100).toFixed(2);
          contNumber.blue = ((contNumber.blue / total) * 100).toFixed(2);
          contNumber.yellow = ((contNumber.yellow / total) * 100).toFixed(2);
          //给柱状图赋值
          bearing.series[0].data = []
          bearing.series[0].data.push(contNumber.red)
          bearing.series[0].data.push(contNumber.blue)
          bearing.series[0].data.push(contNumber.yellow)
          //画图实例-画上连杆瓦
          if (this.$refs.connectingDownBearing) {
            // 初始化图表并设置选项
            this.connectingDownBearing = echarts.init(this.$refs.connectingDownBearing);
            this.connectingDownBearing.setOption(bearing);
          } else {
            console.error('DOM element not found for chart initialization');
          }
        } else {
          // 清空图表中的数据
          if (this.crankshaftUpBearing) {
            this.crankshaftUpBearing.clear();  // 清空图表数据
            this.crankshaftUpBearing.dispose(); // 销毁图表实例
            this.crankshaftUpBearing = null;    // 将实例置为 null
          }
          if (this.crankshaftDownBearing) {
            this.crankshaftDownBearing.clear();  // 清空图表数据
            this.crankshaftDownBearing.dispose(); // 销毁图表实例
            this.crankshaftDownBearing = null;    // 将实例置为 null
          }
          if (this.connectingUpBearing) {
            this.connectingUpBearing.clear();  // 清空图表数据
            this.connectingUpBearing.dispose(); // 销毁图表实例
            this.connectingUpBearing = null;    // 将实例置为 null
          }
          if (this.connectingDownBearing) {
            this.connectingDownBearing.clear();  // 清空图表数据
            this.connectingDownBearing.dispose(); // 销毁图表实例
            this.connectingDownBearing = null;    // 将实例置为 null
          }
        }
      })
    },


    //弹窗表单中，关闭功能
    //无意关闭弹窗的函数
    handleClose(done) {
      this.$confirm('确认关闭？')
          // eslint-disable-next-line no-unused-vars
          .then(_ => {
            done();
          })
          // eslint-disable-next-line no-unused-vars
          .catch(_ => {
          });
    },


    /*---------------------------------------------------辅助函数区域--------------------------------------------------*/
    //辅助函数：  初始化 wangEditor
    initEditor() {
      this.editor = null

      this.editor = new E(this.$refs.editorContainer);
      this.editor.config.menus = [
        'head',
        'bold',
        'italic',
        'underline',
        'strikeThrough',
        'foreColor',
        'backColor',
        'list',
        'justify',
        'table',
        // 其他你需要的菜单...
      ]
      this.editor.create();
    },

    //辅助函数：去读取全部内容
    queryAllProductDataCheckList() {
      return new Promise((resolve, reject) => {
        this.$request.post('/queryAllProductDataCheckListProductDataCheckList').then(result => {
          if (result.code === 401) {
            this.router.push('UserLogin');
            alert("您未登录，请登录");
            reject("未登录"); // 返回错误信息
          } else {

            resolve(result.data)
            console.log(result.data); // 返回数据$
          }
        }).catch(error => {
          reject(error); // 捕获请求错误
        });
      });
    },


    //辅助函数：发动机质量数据查询中，多种条件进行判定筛选，对日期类型的数据，筛选≥某一个值，和＜某一个值，
    queryMultipleConditionsEngineDataQuery(engineNumber, stationId, timeStart, timeEnd, startPage, sizePage) {
      this.loding = true
      return new Promise((resolve, reject) => {
        this.$request.post('/queryMultipleConditionsEngineDataQuery', {
          //查询的变量1-发动机号
          engineNumber: engineNumber,
          //查询的变量2-工序
          stationId: stationId,
          //查询的变量3-开始时间
          timeStart: timeStart,
          //查询的变量3-截止时间
          timeEnd: timeEnd,
          //起始页
          page: startPage,
          //页面大小
          sizePage: sizePage
        }).then(result => {
          if (result.code === 401) {
            this.$router.push('UserLogin');
            alert("您未登录，请登录");
            reject("未登录"); // 返回错误信息
          } else {
            this.loding = false
            resolve(result.data); // 返回数据
          }
        }).catch(error => {
          this.loding = false
          reject(error); // 捕获请求错误
        });
      });
    },

    //辅助函数：发动机物料数据查询中，多种条件进行判定筛选，对日期类型的数据，筛选≥某一个值，和＜某一个值，
    queryMaterialEngineDataQuery(engineNumber, materialName, stationId, timeStart, timeEnd, startPage, sizePage) {
      this.loding = true
      return new Promise((resolve, reject) => {
        this.$request.post('/queryMaterialEngineDataQuery', {
          //查询的变量-发动机号
          engineNumber: engineNumber,
          //查询的变量-物料名称
          materialName: materialName,
          //查询的变量-工序
          stationId: stationId,
          //查询的变量-开始时间
          timeStart: timeStart,
          //查询的变量-截止时间
          timeEnd: timeEnd,
          //起始页
          page: startPage,
          //页面大小
          sizePage: sizePage
        }).then(result => {
          if (result.code === 401) {
            this.$router.push('UserLogin');
            alert("您未登录，请登录");
            reject("未登录"); // 返回错误信息
          } else {
            this.loding = false
            resolve(result.data); // 返回数据
          }
        }).catch(error => {
          this.loding = false
          reject(error); // 捕获请求错误
        });
      });
    },

    //辅助函数：发动机过站数据查询中，多种条件进行判定筛选，对日期类型的数据，筛选≥某一个值，和＜某一个值，
    queryStationEngineDataQuery(engineNumber, stationId, timeStart, timeEnd, startPage, sizePage) {
      this.loding = true
      return new Promise((resolve, reject) => {
        this.$request.post('/queryStationEngineDataQuery', {
          //查询的变量-发动机号
          engineNumber: engineNumber,
          //查询的变量-工序
          stationId: stationId,
          //查询的变量-开始时间
          timeStart: timeStart,
          //查询的变量-截止时间
          timeEnd: timeEnd,
          //起始页
          page: startPage,
          //页面大小
          sizePage: sizePage
        }).then(result => {
          if (result.code === 401) {
            this.$router.push('UserLogin');
            alert("您未登录，请登录");
            reject("未登录"); // 返回错误信息
          } else {
            this.loding = false
            resolve(result.data); // 返回数据
          }
        }).catch(error => {
          this.loding = false
          reject(error); // 捕获请求错误
        });
      });
    },

    //辅助函数：发动机选瓦数据查询中，多种条件进行判定筛选，对日期类型的数据，筛选≥某一个值，和＜某一个值，
    queryChooseEngineDataQuery(engineNumber, timeStart, timeEnd) {
      this.loding = true
      return new Promise((resolve, reject) => {
        this.$request.post('/queryChooseEngineDataQuery', {
          //查询的变量-发动机号
          engineNumber: engineNumber,
          //查询的变量-开始时间
          timeStart: timeStart,
          //查询的变量-截止时间
          timeEnd: timeEnd,
        }).then(result => {
          if (result.code === 401) {
            this.$router.push('UserLogin');
            alert("您未登录，请登录");
            reject("未登录"); // 返回错误信息
          } else {
            this.loding = false
            resolve(result.data); // 返回数据
          }
        }).catch(error => {
          this.loding = false
          reject(error); // 捕获请求错误
        });
      });
    },


    //辅助函数，获得当前的年月日
    getCurrentDate() {
      const now = new Date();
      const year = now.getFullYear();
      const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份从0开始，所以要加1
      const day = String(now.getDate()).padStart(2, '0');

      return `${year}-${month}-${day}`;
    },
    //辅助函数，读取当前时间的函数并转化成yyyy-MM-dd HH：mm：ss 的格式
    formatDate(date) {
      const year = date.getFullYear();
      const month = String(date.getMonth() + 1).padStart(2, '0');  // 月份从0开始，所以要加1，并且确保是2位数
      const day = String(date.getDate()).padStart(2, '0'); // 确保是2位数
      const hours = String(date.getHours()).padStart(2, '0'); // 时
      const minutes = String(date.getMinutes()).padStart(2, '0'); // 分
      const seconds = String(date.getSeconds()).padStart(2, '0'); // 秒

      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
    }

  },
  //***页面加载初始化执行的内容***
  mounted() {

    this.inquiry()

    //初始化可疑品清单的默认选择值
    this.suspectDisposalShowForm = null
    this.queryTorqueListShowData = []
    this.queryMaterialListShowData = []
  },
}
</script>

<style scoped>
/* 主体左侧的工作步骤栏用到的数据包围的div的样式*/

.el-footer {
  background-color: #ffffff;
  color: #333;
  text-align: center;
  border-width: 3px; /* 设置边框宽度为3像素 */
  border-color: blue; /* 设置边框颜色为蓝色 */
  border-style: solid; /* 设置边框样式为实线 */
  padding: 10px; /* 添加内边距 */
  border-left-color: white;
  border-top: white;
}

.el-aside {
  background-color: #ffffff;
  color: #333;
  text-align: center;
  border-width: 3px; /* 设置边框宽度为3像素 */
  border-color: blue; /* 设置边框颜色为蓝色 */
  border-style: solid; /* 设置边框样式为实线 */
  padding: 10px; /* 添加内边距 */
  height: 89vh;
}

.el-main {
  color: #333;
  text-align: center;
  border-width: 3px; /* 设置边框宽度为3像素 */
  border-color: blue; /* 设置边框颜色为蓝色 */
  border-left-color: white;
  border-style: solid; /* 设置边框样式为实线 */
  padding: 10px; /* 添加内边距 */
  overflow: auto;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}

.headMain {
  color: #ffffff; /* 设置字体颜色为红色 */
  font-size: 18px;
}

.center-text {
  /* 使用 margin-left 和 margin-right auto 来实现居中效果 */
  margin-left: auto;
  margin-right: auto;
  /* 注意：如果 header 内只有这两个元素，你可能不需要 margin-right: auto */
}

.el-container {
  overflow: auto; /* 自动显示滚动条当内容溢出时 */
  /* 或者 */
  overflow-x: auto; /* 仅水平滚动 */
  overflow-y: auto; /* 仅垂直滚动 */
}

/*自定义样式*/

</style>